﻿using System.Linq;

using ESoft.Core.Data.Service;
using ESoft.Core.Web.Common.Filters;
using ESoft.Core.Web.Utils;
using ESoft.Core.Web.VO;
using ESoft.Portal.Data.Domain.Entity;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace ESoft.Portal.ApiControllers
{
    [Route("api/site/setting")]
    [SkipUserAuthorize]
    public class SettingRestController : Controller
    {
        private readonly IBaseService _baseService;

        public SettingRestController(IBaseService baseService)
        {
            _baseService = baseService;
        }

        [Route("QueryBasic")]
        [HttpGet]
        public object QueryBasic()
        {
            return ResponseResult.Success(_baseService.QueryEntities<UOrgEntity>().FirstOrDefault());
        }
    }
}
